<!-- edit.html -->
{% extends "base.html" %}

{% block content %}
<h2>编辑记录</h2>
<form method="post">
    <div class="mb-3">
        <label class="form-label">类型</label>
        <select name="note_type" class="form-select">
            <option value="daily" {% if note.note_type == 'daily' %}selected{% endif %}>每日</option>
            <option value="weekly" {% if note.note_type == 'weekly' %}selected{% endif %}>每周</option>
            <option value="monthly" {% if note.note_type == 'monthly' %}selected{% endif %}>每月</option>
        </select>
    </div>
    <div class="mb-3">
        <label class="form-label">日期</label>
        <input type="date" name="timestamp" class="form-control" required
               value="{{ note.timestamp.strftime('%Y-%m-%d') }}">
    </div>
    <div class="mb-3">
        <label class="form-label">内容</label>
        <textarea name="content" class="form-control" rows="5" required>{{ note.content }}</textarea>
    </div>
    <button type="submit" class="btn btn-primary">保存修改</button>
</form>
{% endblock %}